{* Notice: This template is recursive. *}
{if is_null($level)} 
{assign var=level value=0}
{/if}
{if count($nav_items) gt 0}	
	<ul{if $level eq 0} class="editnav"{/if}>
		{foreach from=$nav_items item=nav_item key=index name=linklist}
			<li class="level-{$level}">
				<div class="buttons clearfix">
					<span class="linkname level-{$level}">{$nav_item.link_text|truncate:30}</span>
					{if $smarty.foreach.linklist.first}
						<span class="icon"></span>
					{else}
						<a class="icon up" href="/navigation/moveup/nav_id/{$nav_item.id}/parent_id/{$nav_item.parent_id}/role_id/{$role.id}">Move Up</a>
					{/if}
					
					{if $smarty.foreach.linklist.last}
						<span class="icon"></span>
					{else}
						<a class="icon down" href="/navigation/movedown/nav_id/{$nav_item.id}/parent_id/{$nav_item.parent_id}/role_id/{$role.id}">Move Down</a>
					{/if}					
					<a class="icon edit" href="/navigation/edit/nav_id/{$nav_item.id}/role_id/{$role.id}">Edit</a>					
					<a class="icon delete" href="/navigation/delete/nav_id/{$nav_item.id}/role_id/{$role.id}">Delete</a>
					
				</div>
				{include file="file:$current_path/_role_nav_tree.tpl" nav_items=$nav_item.children level=$level+1}
			</li>
		{/foreach}
	</ul>
{/if}
